package com.yuwei.home.parking_space_management.add_car_view

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.yuwei.base.BaseViewModel
import com.yuwei.http.ApiService
import com.yuwei.http.entity.AddParkingBodyEntity
import com.yuwei.http.entity.AddParkingEntity
import com.yuwei.http.entity.ParkingEntity
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class AddParkingViewModel @Inject constructor(
    val apiService: ApiService
):BaseViewModel() {
    val getAddParkingSuccess by lazy { MutableLiveData<AddParkingBodyEntity>() }
    fun getAddParking(addParkingEntity: AddParkingEntity){
        viewModelScope.launch {
            executeNetwork({
                apiService.getAddParking(addParkingEntity)
            },getAddParkingSuccess::postValue)
        }
    }

}